package com.trade.wzj.service.you;

import java.util.List;

import com.trade.wzj.dao.you.SupplierDao;
import com.trade.wzj.model.xiang.ClientInfo;
import com.trade.wzj.model.xiang.ClientQuotaDetails;
import com.trade.wzj.model.xiang.SupplierInfo;


public class SupplierServiceImpl implements SupplierService {

	private SupplierDao sdao;

	public SupplierDao getSdao() {
		return sdao;
	}

	public void setSdao(SupplierDao sdao) {
		this.sdao = sdao;
	}

	@Override
	public SupplierInfo supProSel(Integer id) {
		SupplierInfo list=null;
		try {
			list=sdao.supProSel(id);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

	//通过id修改供应商报价信息
	@Override
	public void updateSupplierPrice(SupplierInfo supplier) throws Exception {
		try {
			if(supplier.getSupplierInfoID()!=null) {
				sdao.updateSupplierPrice(supplier);
			}else {
				throw new Exception();
			}
		} catch (Exception e) {
			throw new Exception();
		}
	}

	/**
	 * 根据产品信息表的id查询客户报价详情表
	 */
	public List<ClientQuotaDetails> selectClientQuotaDetails(Integer id){
		List<ClientQuotaDetails> list=null;
		try {
			if(null!=id) {
				list=sdao.selectClientQuotaDetails(id);
			}
			else {
				throw new Exception();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}


	
}
